package nl.mikoosoft.sport.stoer.domain;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.serializable.RooSerializable;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.validation.constraints.Size;
import nl.mikoosoft.sport.stoer.domain.Division;

@RooJavaBean
@RooToString
@RooEntity(identifierColumn = "team_id", versionColumn = "revision")
@RooSerializable
public class Team {

    @NotNull
    @Column(unique = true)
    @Size(min = 1, max = 10)
    private String designator;

    @NotNull
    @ManyToOne(fetch = FetchType.EAGER)
    private Club club;

    @ManyToOne
    private Division division;
}
